<template>
	<div>
		<Carousel autoplay v-model="value2" v-if="ishidden">
        <Carousel-item v-for="item in focus" :key="item.id">
            <div class="demo-carousel">
            	<img :src="item.img" />
            </div>
        </Carousel-item>
        </Carousel>
	</div>
</template>

<script>
	import { mapState } from 'vuex'
export default {
	data(){
		return {
             value2: 0
		}
	},
	computed:{
		...mapState(['focus','ishidden']),

	},
	created(){
    this.getfocus();
	},
	methods:{
      getfocus(){
		this.showrouters = this.$route.path.split('/');
        if(this.showrouters.length == 3)
        {this.$store.commit('Ishidden')}
        else
        {this.$store.commit('Ishidden2')}
       }
	},
	watch:{
	  "$route":"getfocus"
	}

}
</script>

<style scoped>
	img{width: 100%;height: 100px;display: block;}
</style>
